package com.wxzz.elearing.user.api.server;

import com.wxzz.elearing.user.entity.OperationLog;
import com.wxzz.elearing.user.mapper.OperationLogMapper;
import com.wxzz.elearning.common.dto.FeignOperationLogDto;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Optional;
import java.util.OptionalLong;

@RestController
@RequestMapping("/operation-log-api")
public class OperationLogApi {

    @Autowired
    private OperationLogMapper operationLogMapper;

    @RequestMapping(value = "insert", method = RequestMethod.POST)
    public void insert(@RequestBody FeignOperationLogDto feignOperationLogDto) {
        OperationLog operationLog = new OperationLog();
        BeanUtils.copyProperties(feignOperationLogDto, operationLog);
        operationLogMapper.insert(operationLog);
    }

}
